/**
 * 
 */
package com.dsteiner.widgets.client.model;

import java.beans.PropertyChangeListener;

import com.dsteiner.widgets.client.PropertyChangeCollection;
import com.dsteiner.widgets.client.Widgets;
import com.dsteiner.widgets.client.Widgets.IWidget;

public class PopupOverlayModel {
	private PropertyChangeCollection propertyChangeSupport = new PropertyChangeCollection(
			this);

	private IWidget contentWidget;
	
	private int top;

	private int left;

	private boolean visible;

	private boolean showCloseLink = true;

	public void addPropertyChangeListener(String propertyName,
			PropertyChangeListener listener) {
		propertyChangeSupport.registerPropertyChangeListener(propertyName,
				listener);
	}

	public IWidget getContentWidget() {
		return contentWidget;
	}
	public int getLeft() {
		return left;
	}

	public boolean getShowCloseLink() {
		return showCloseLink;
	}

	public int getTop() {
		return top;
	}
	
	public boolean isVisible() {
		return visible;
	}

	public void setContentWidget(IWidget contentWidget) {
		IWidget oldContentWidget = this.contentWidget;
		this.contentWidget = contentWidget;
		propertyChangeSupport.firePropertyChange("contentWidget", oldContentWidget, contentWidget);
	}

	public void setLeft(int left) {
		int oldLeft = this.left;
		this.left = left;
		propertyChangeSupport.firePropertyChange("left", oldLeft, left);
	}

	public void setShowCloseLink(boolean showCloseLink) {
		boolean oldShowCloseLink = this.showCloseLink;
		this.showCloseLink = showCloseLink;
		propertyChangeSupport.firePropertyChange("showCloseLink", oldShowCloseLink, showCloseLink);
	}

	public void setTop(int top) {
		int oldTop = this.top;
		this.top = top;
		propertyChangeSupport.firePropertyChange("top", oldTop, top);
	}

	public void setVisible(boolean visible) {
		boolean oldVisible = this.visible;
		this.visible = visible;
		propertyChangeSupport.firePropertyChange("visible", oldVisible, visible);
	}
}